<template>
  <div class="notice_container">
    <div class="page_title">部门文件夹</div>
    <div class="portal_list">
      <div class="portal_item" v-for="(item, index) in PortalList" :key="index" @click="portalLookClick(item)">
        <div class="icon_box" :style="{ backgroundColor: item.iconColor }">
          <svg-icon :icon-class="item.icon" style="font-size: 26px"></svg-icon>
        </div>
        <div class="item_text">{{ item.name }}</div>
      </div>
    </div>
  </div>
</template>
  
  
<script setup lang='ts'>
import { apiSysPortalConfigure , apiSysPortalConfigureGetportalFile} from '@/api/enterpriseDoc/enterpriseDoorApi';
const PortalList = ref<any[]>([]);
const props = defineProps({
    rowData: {
        type: Object,
        default: () => {}
    }
})
const emit = defineEmits(['portalLookClick'])
// 获取数据
const getDoorFolderData = async () => {
  let res: any = await apiSysPortalConfigure({libraryId: props.rowData.id});
  if (res.code == 200) {
    PortalList.value = res.data;
  }
};
// 点击查看
const portalLookClick = async (row) =>{
    console.log(row);
    let res:any =await apiSysPortalConfigureGetportalFile(row.fileId);
    emit('portalLookClick', res.data)
}
onMounted(() => {
  getDoorFolderData();
});
</script>
<style scoped lang='scss'>
.notice_container {
  .page_title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 5px;
  }
}
.portal_list {
  display: flex;

  .portal_item {
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    &:hover {
      background-color: #eff4ff;
    }
  }
  .icon_box {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin: 0 auto;
  }
  .item_text {
    margin-top: 10px;
    font-size: 14px;
    color: #303133;
  }
}
</style>